<template>
  <div class="content">
    <div class="head">
      <img class="headimg" :src="item.cover" alt="" />
      <div class="headContent">
        <div>{{item.filmName}} </div>
        <div>时长:{{item.duration}}分钟 </div>
        <div>上映日期:{{item.publishDate}} </div>
        <div>类型:{{item.type}} </div>
      </div>
      <div class="pf">{{item.score/100==0?'暂无评分':item.score/100}}</div>
    </div>
    <div class="detail">
      <div class="detailTop">
        <div class="top1">影片简介</div>
      </div>
      <div class="detailcontent">
        {{item.introduction}}
      </div>
    </div>
   <!-- <div style="height: 10px;background-color: #EBF2FC;"></div>
    <div class="bottom">
      <div class="bottomTop">演职人员</div>
      <div class="btList">
        <div class="lists" v-for="(item,index) in 10" :key="index">
          <img src="../../../static/index10.png" alt="" />
          <div class="listName">村濑步</div>
        </div>
      </div>
     <div class="bottomTop">剧照</div>
      <div class="btList2">
        <div class="lists" v-for="(item,index) in 10" :key="index">
          <img src="../../../static/index10.png" alt="" />
        </div>
      </div>
    </div> -->
    <div class="button" @click="gotoList">{{item.preSaleFlag==0?'立即购票':'预售'}}</div>
  </div>
</template>
<script>
import {
  setStore,
  getStore,
  removeStore
} from '@/utils/storage'
import { map } from 'qqmap';
import wx from 'weixin-js-sdk'
import 'swiper/dist/css/swiper.css'
import { swiper, swiperSlide } from 'vue-awesome-swiper'
import {getFilmInfo} from '@/api/home.js'
import { Tab, Tabs } from 'vant';
export default {
  name: 'Detail',
 data(){
    return{
      item:{},
      id:''
	 }
	},
  mounted() {
    console.log(this.$route.query.id)
    this.id = this.$route.query.id
    this.getFilmInfo()
  },
	methods:{
    getFilmInfo(){
      let data = {
        id:this.id
      }
      getFilmInfo(data).then(res=>{
        console.log(res)
        this.item = res.data
        let time = new Date(this.item.publishDate*1000)
        let y = time.getFullYear()
        let m = time.getMonth()+1
        let d = time.getDate()
        this.item.publishDate = y+'-'+m+'-'+d
        console.log(this.item.publishDate)
        this.$forceUpdate()

      })
    },
    //根据电影寻找影院列表
    gotoList(){
      this.$router.push({
        path:'/cinemaList?filmCode='+this.item.filmCode
      })
    },
	}
}
</script>

<style lang="less" scoped>
.content{
  width: 100vw;
  min-height: 100vh;
  background-color: #fff;
  box-sizing: border-box;
  padding-bottom: 100px;
  overflow: hidden;
  .head{
    width: 375px;
    height: 255px;
    background: url('../../../static/indexBj.png') no-repeat;
    background-size: 100% 100%;
    overflow: hidden;
    position: relative;
    .headimg{
      width: 106px;
      height: 150px;
      display: block;
      position: absolute;
      top: 84px;
      left: 21px;
      z-index: 9;
    }
    .headContent{
      width: 375px;
      height: 140px;
      background-color: #5A5A5A66;
      position: absolute;
      bottom: 0;
      left: 0;
      z-index: 8;
      box-sizing: border-box;
      padding-left: 138px;
      div:nth-child(1){
        font-size: 16px;
        margin-top: 14px;
      }
      div{
        font-size: 14px;
        color: #FFFFFF;
        margin-top: 4px;
      }
    }
    .pf{
      position: absolute;
      top: 184px;
      right: 18px;
      font-weight: bold;
      font-size: 20px;
      color: #FF6060;
    }
  }
  .detail{
    width: 375px;
    min-height: 121px;
    background-color: #fff;
    box-sizing: border-box;
    padding: 16px;
    .detailTop{
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      .top1{
        font-weight: 500;
        font-size: 20px;
        color: #333333;
      }
      .top2{
        font-size: 16px;
        color: #636363;
      }
    }
    .detailcontent{
      font-size: 14px;
      color: #333333;
      margin-top: 15px;
    }
  }
  .bottom{
    width: 100%;
    height: 377px;
    .bottomTop{
      font-size: 20px;
      color: #333333;
      margin: 16px 0 0 21px;
    }
    .btList{
      width: 100%;
      height: 144px;
      display: flex;
      align-items: center;
      padding: 16px 50px 16px 16px;
      overflow: auto;
      box-sizing: border-box;
      img{
        display: block;
        width: 63px;
        height: 90px;
        margin-left: 8px;
      }
      .listName{
        margin-top: 9px;
        font-size: 14px;
        color: #333333;
        text-align: center;
      }
    }
    .btList2{
      width: 100%;
      height: 64px;
      display: flex;
      align-items: center;
      padding: 8px 16px;
      overflow: auto;
      img{
        display: block;
        width: 119px;
        height:64px;
        margin-left: 8px;
      }
    }
  }
  .button{
    width: 249px;
    height: 41px;
    position: fixed;
    bottom: 33px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1583FF;
    text-align: center;
    line-height: 41px;
    font-size: 19px;
    color: #FFFFFF;
    border-radius: 21px 21px 21px 21px;
  }
}
</style>
